<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use think\model\relation\BelongsTo;

/**
 * @mixin \think\Model
 */
class AdminClass extends Model
{
    //
    protected $autoWriteTimestamp = true;

    public function school() {
        return $this->belongsTo(AdminSchool::class, 'school_id')
            ->where('is_delete', 0)->bind([
                'school_name' => 'name'
            ]);
    }

    public function staff() {
        return $this->belongsTo(AdminStaff::class, 'staff_id')
            ->where('is_delete', 0);
    }
}
